package com.cloud.api.annotation;

import com.cloud.api.config.EnumNotNullValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author 杨斌
 * 2024-08-30/8/2024
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = EnumNotNullValidator.class)
public @interface EnumNotNull {
    String message() default "The enum value must not be null";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}

